package com.hwadee.property.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsAutoIncrement;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.command.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.LinkedHashMap;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "user_activity_log")//用户活动日志表
public class UserActivityLog extends BaseModel{
    @TableId(type = IdType.AUTO) // mybatis-plus主键注解
    @IsAutoIncrement   // 自增
    @IsKey             // actable主键注解
    @Column(comment = "日志ID") // 对应数据库字段，不配置name会直接采用属性名作为字段名comment是注解
    private Long id;

    @TableField(exist = false)
    private LinkedHashMap<String, String> orderBy;

    @TableField(exist = false)
    private int currentPage;

    @TableField(exist = false)
    private int pageSize;

    @TableField(exist = false)
    private int start;

    @Column(comment = "行为者ID，该userId指向行动的主体")
    @TableField("user_id")
    private Long userId;
    @Column(comment = "所属小区ID，如果行为者为管理员，该项为null")
    @TableField("community_id")
    private Long communityId;
    @Column(comment = "活动详情，记录具体的活动内容，如通知内容、投诉内容等")
    @TableField("activity_detail")
    private String activityDetail;
    @Column(comment = "活动时间，记录用户操作的时间")
    @TableField("activity_time")
    private String activityTime;
    @Column(comment = "涉及金额")
    private Double amount;
    @Column(comment = "日志类型")
    @TableField("log_type")
    private String logType;
    @Column(comment = "关联记录ID，如投诉表的id、通知表的id等，方便追溯关联数据")
    @TableField("related_record_id")
    private String relatedRecordId;
}
